package com.xc.c1

package com.xc.c1

object fun1 {

  def main(args: Array[String]): Unit = {
    val dog = new Dog
    val f1 = dog.sum _
    println("f1 sum = " + f1(10, 20))
    sayName()
    sayName("keke")
    sayHello(age = 28)
  }

  def sayName(name: String = "hxc"): Unit = {
    println("name = " + name)
  }

  def sayHello(name: String = "hxc", age: Int = 18): Unit = {
    println("name = " + name + ",age = " + age)
  }

}


class Dog {

  def sum(a: Int, b: Int): Int = {
    a + b
  }
}
